package org.pangu.common;

import java.util.LinkedHashSet;
import java.util.Set;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class DefaultListableBeanFactoryImpl extends DefaultListableBeanFactory {
	
	/**
	 * 打印放入IOC的单例bean
	 */
	@Override
	protected void addSingleton(String beanName, Object singletonObject) {
		super.addSingleton(beanName, singletonObject);
		//打印到console
		System.err.println("IOC缓存beanName-> "+beanName +" 对象-> "+singletonObject);
		//记录到日志文件
		log.info("IOC缓存beanName-> "+beanName +" 对象-> "+singletonObject);
	}
}
